package com.yami.shop.api.listener;

import com.yami.shop.bean.event.PaySuccessOrderEvent;
import com.yami.shop.bean.event.ReceiptOrderEvent;
import com.yami.shop.bean.order.PaySuccessOrderOrder;
import com.yami.shop.bean.order.ReceiptOrderOrder;
import com.yami.shop.service.PayService;
import lombok.AllArgsConstructor;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("defaultPaySuccessOrderListener")
@AllArgsConstructor
public class PaySuccessOrderListener {

    private final PayService payService;

    @EventListener(PaySuccessOrderEvent.class)
    @Order(PaySuccessOrderOrder.DEFAULT)
    public void defaultReceiptOrderListener(PaySuccessOrderEvent event) {
        List<String> strings = payService.paySuccess(event.getPayNo(), event.getBizPayNo());
    }
}
